package com.yzc.pve;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yzc.pojo.Pve;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yzc.pojo.Tour;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author Yzc
* @description 针对表【t_pve】的数据库操作Mapper
* @createDate 2024-06-17 21:13:24
* @Entity com.yzc.pojo.Pve
*/
@Mapper
public interface PveMapper extends BaseMapper<Pve> {


    @Select("SELECT pve.pvename, COUNT(tour.tourname) AS tourcount, " +
            "GROUP_CONCAT(tour.tourname SEPARATOR ', ') AS tournames " +
            "FROM t_pve pve " +
            "LEFT JOIN t_tour tour ON tour.address LIKE CONCAT('%', pve.pvename, '%') " +
            "GROUP BY pve.pvename")
    List<Pve> selectBypvenameOnaddress();

}




